<!--
 * @Author: HeAo
 * @Date: 2022-07-27 10:58:00
 * @LastEditTime: 2022-08-30 19:05:18
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \HTML5&CSS3\第九天\5-animation.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      width: 100px;
      height: 100px;
      background-color: red;
      /*动画配置 */
      /* 1、设置动画名称 */
      animation-name: LeftToRight;
      /* 2、动画持续时间 */
      animation-duration: 2s;
      /* 3、动画执行速度 */
      animation-timing-function: linear;
      /* 4、等待时长 */
      /* animation-delay: 2s; */
      /* 5、设置动画播放次数 */
      animation-iteration-count: infinite;
      /* 6、设置动画是否反向播放 */
      animation-direction: alternate;
      /* 7、动画结束时应用最后一帧 */
      animation-fill-mode: forwards;
      /* animation: name duration timing-function delay iteration-count direction fill-mode; */
    }

    /* 动画关键帧 */
    div:hover {
      /* 设置动画是否暂停*/
      animation-play-state: paused;
    }

    @keyframes LeftToRight {
      0% {
        margin-left: 0px;
      }

      25% {
        margin-left: 200px;
      }

      50% {
        margin-left: 300px;
      }

      75% {
        margin-left: 500px;
      }

      100% {
        margin-left: 1000px;
      }
    }
  </style>

</head>

<body>
  <div>

  </div>

</body>

</html>